Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiplatform BLE stack for ISO/IEC 18013-5:2021 proximity. #814

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

davidz25
Copy link
Contributor

@davidz25 davidz25 commented Dec 5, 2024

This adds new multiplatform API to the identity-mdoc library for ISO/IEC 18013-5:2021 proximity presentations. It works on both Android and iOS and both operating systems share a lot of common code.

Also add support two new pages - "ISO mdoc Proximity Sharing" and "ISO mdoc Proximity Reading" - to the multi-platform test app. This only includes QR engagement, NFC engagement will be added in a future change. These two pages represent feature complete mDL and mDL reader functionality and are designed to work with other implementations as well as with itself.

Also introduce rememberBluetoothPermissionState composable function and BluetoothPermissionState object which can be used to obtain the required permissions on BLE on both Android and iOS.

Also devise a new multi-testing framework for automatically testing a number of mDL presentations between two devices. This is available in a new "ISO mdc Multi-Device Testing" page in the test app and the way it works is that the 1st device offers a QR code that the 2nd device scans. This sets up a TCP/IP control plane used for initiating tests, including sharing DeviceEngagement. This helps ensure the code is robust and well-tested both for happy paths and with all the various termination options available in the standard.

Also modify existing L2CAP support so it follows the latest draft of the upcoming second edition of ISO 18013-5:2021. In particular, this means framing the SessionData / SessionEstablishment packets sent over the L2CAP socket.

Modify ScanQrCodeDialog and ShowQrCodeDialog so they are easy to extend.

Include portrait ans signature images in sample data in identity-doctypes.

Test: Manually tested against wallet app and well-known readers.

@davidz25 davidz25 requested review from kdeus and sorotokin December 5, 2024 21:28
@davidz25 davidz25 force-pushed the kotlin-mp-transport-abstraction branch from 6988867 to 91b9c7c Compare December 10, 2024 22:43
Copy link
Contributor

@kdeus kdeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass...several suggestions that may need to be applied to all similar files. Or feel free to push back on any of them. I'll make another pass once you've had a chance to review these comments.

@davidz25 davidz25 force-pushed the kotlin-mp-transport-abstraction branch from 91b9c7c to f9685eb Compare December 13, 2024 18:23
@kdeus kdeus self-requested a review December 16, 2024 22:27
This adds new multiplatform API to the identity-mdoc library for
ISO/IEC 18013-5:2021 proximity presentations. It works on both Android
and iOS and both operating systems share a lot of common code.

Also add support two new pages - "ISO mdoc Proximity Sharing" and "ISO
mdoc Proximity Reading" - to the multi-platform test app. This only
includes QR engagement, NFC engagement will be added in a future
change. These two pages represent feature complete mDL and mDL reader
functionality and are designed to work with other implementations as
well as with itself.

Also introduce `rememberBluetoothPermissionState` composable function
and `BluetoothPermissionState` object which can be used to obtain the
required permissions on BLE on both Android and iOS.

Also devise a new multi-testing framework for automatically testing a
number of mDL presentations between two devices. This is available in
a new "ISO mdc Multi-Device Testing" page in the test app and the way
it works is that the 1st device offers a QR code that the 2nd device
scans. This sets up a TCP/IP control plane used for initiating tests,
including sharing `DeviceEngagement`. This helps ensure the code is
robust and well-tested both for happy paths and with all the various
termination options available in the standard.

Also modify existing L2CAP support so it follows the latest draft of
the upcoming second edition of ISO 18013-5:2021. In particular, this
means framing the `SessionData` / `SessionEstablishment` packets sent
over the L2CAP socket.

Modify `ScanQrCodeDialog` and `ShowQrCodeDialog` so they are easy to
extend.

Include portrait ans signature images in sample data in
identity-doctypes.

Test: Manually tested against wallet app and well-known readers.

Signed-off-by: David Zeuthen <[email protected]>
@davidz25 davidz25 force-pushed the kotlin-mp-transport-abstraction branch from f9685eb to 0c5aa3e Compare December 16, 2024 23:27
@davidz25
Copy link
Contributor Author

Thanks for the review! Replaced all occurrences of 0x01 and 0x02 with BleTransportConstants.STATE_CHARACTERISTIC_END and _START.

@davidz25 davidz25 merged commit 98dcccb into main Dec 16, 2024
5 checks passed
@davidz25 davidz25 deleted the kotlin-mp-transport-abstraction branch December 16, 2024 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants